<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>InSTEDD | Sent surveys</title>
    <link href="css/main.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/forms-client.js"></script>
    <script type="text/javascript" src="js/survey.js"></script>
</head>
<body id="body" onload="LoadSurveys()">
    <script type="text/javascript">
        var fileSystemObject = top.fileSystemObject;
        var sentFolder = getSentFolder(fileSystemObject);
        
        function LoadSurveys()
        {
            document.getElementById('filesDiv').innerHTML = '';
            ExecuteForEach(sentFolder.Files, DisplaySurveyFile);
        }
                        
        function DisplaySurveyFile(surveyPath)
        {
            var survey = new CreateSurveByFilePath(surveyPath);            

            var surveyFile = fileSystemObject.GetFile(surveyPath);  
            var surveyEditUrl = 'Survey.htm?surveyFile=' + surveyFile.Name + '&surveyFolder=sent';         
            document.getElementById('filesDiv').innerHTML = 
                    document.getElementById('filesDiv').innerHTML + 
                    '<a class="surveyListItemlink" href="' +  surveyEditUrl + '">' + survey.getId() + '</a>' + 
                    '&nbsp&nbsp<span class="surveyListItem">' + survey.getFirstName() + '&nbsp' + survey.getLastName() +
                    '</span><br/>';            
        }        
    </script>
    
    
    <div>
        <div class="sectionCaption">Forms sent</div>
        <div class="tip">(You can edit sent forms and they will be resent)</div><br />
        <div id="filesDiv">
        </div>
    </div>
        
</body>
</html>
